using System;
using System.IO;

namespace ByteShower
{
    static partial class ProgramData
    {
        public const string Warn_FileCreate_0 = "File has existed! Whether to replace(y/n)?";
    }
    partial class Program
    {
        static void CreateFile()
        {
            if(File.Exists(path)) {
                Warn(ProgramData.Warn_FileCreate_0);
                ConsoleKey key = Console.ReadKey().Key;
                if(key == ConsoleKey.Y) {
                    BackSpace(ProgramData.Warn_FileCreate_0);
                    File.Delete(path);
                    File.Create(path).Dispose();
                }
                else
                    BackSpace(ProgramData.Warn_FileCreate_0);
            }
            else
                File.Create(path).Dispose();
        }
    }
}